//
//  TestLabelFactory.swift
//  ios_native_view
//
//  Created by 李旭峰 on 2020/7/10.
//

import UIKit
import Flutter

public class TestLabelFactory: NSObject,FlutterPlatformViewFactory {
    var messenger: FlutterBinaryMessenger
    public static func register(withRegistrar registrar:FlutterPluginRegistrar){
        let messenger = registrar.messenger() as! (NSObject & FlutterBinaryMessenger)
        let factory = TestLabelFactory(messenger: messenger)
        registrar.register(factory, withId: TestLabel.viewName)
    }
    @objc public init(messenger:(NSObject & FlutterBinaryMessenger)) {
        self.messenger = messenger
        super.init()
    }
    public func createArgsCodec() -> FlutterMessageCodec & NSObjectProtocol {
        return FlutterStandardMessageCodec.sharedInstance()
    }
    public func create(withFrame frame: CGRect, viewIdentifier viewId: Int64, arguments args: Any?) -> FlutterPlatformView {
        return TestLabel(frame, viewID: viewId, args: args, binaryMessenger: self.messenger)
    }
}
